import { useEffect } from 'react'
import { useDispatch, useSelector } from 'react-redux'
import { getChannel } from '@/store/actions/login'

export default function useChannel () {
  const dispatch = useDispatch()
  useEffect(() => {
    dispatch(getChannel())
  }, [])
  const channels = useSelector((state) => state.login.channels)
  return channels
}
